Machine Learning Projects for .NET Developers by Mathias Brandewinder
Author:Mathias Brandewinder
Language: eng
Format: epub, pdf
Publisher: Apress, Berkeley, CA
Getting to Know Our Data
Given the exploratory nature of our task, we will, once again, work from the F# scripting environment. Let’s create a new solution with an F# library project, Unsupervised, and, for convenience, add the data file to the solution itself. The dataset is in the form of a text file, userprofiles-toptags.txt, and can be downloaded from the following link: http://1drv.ms/1M727fP . If you take a look at it from Visual Studio, you should see something like this:
UserID,.net,ajax,android,arrays,asp.net,asp.net-mvc,c,c#,c++,css,django,html,ios,iphone,java,javascript,jquery,json,linux,mysql,objective-c,php,python,regex,ruby,ruby-on-rails,sql,sql-server,wpf,xml
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1000343,0,0,0,0,0,0,0,0,0,3,0,5,0,0,0,0,0,0,0,0,0,0,2,52,0,0,0,0,0,0
100297,0,0,0,26,0,0,0,0,0,0,99,62,0,0,0,29,0,182,0,26,0,0,4478,172,0,0,32,0,0,27
100342,0,0,0,0,0,1,0,0,0,0,0,3,0,0,0,16,5,0,0,0,0,0,0,0,1,7,0,0,0,0
The first row is a header describing the contents of each column. The first column contains the user ID, followed by 30 comma-separated columns, each of which contains the level of activity for that particular user and tag.
Before diving into algorithms, let’s start with basic statistics to get a sense for the lay of the land. We’ll begin with opening the Script.fsx file. We will read every line, drop the user IDs (which we don’t really need), and parse each line into an array of floats. We could also keep the values as integers, but as we are likely going to perform operations such as averages, we might as well directly convert to an easy-to-work-with type. We will also keep the headers in a separate array so that we can later map columns to the proper tag name.
Listing 5-1. Reading the dataset in memory
open System
open System.IO
let folder = __SOURCE_DIRECTORY__
let file = "userprofiles-toptags.txt"
let headers,observations =
let raw =
folder + "/" + file
|> File.ReadAllLines
// first row is headers, first col is user ID
let headers = (raw.[0].Split ',').[1..]
let observations =
raw.[1..]
|> Array.map (fun line -> (line.Split ',').[1..])
|> Array.map (Array.map float)
headers,observations
Download
Machine Learning Projects for .NET Developers by Mathias Brandewinder.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Test-Driven Development with Java by Alan Mellor(6712)
Data Augmentation with Python by Duc Haba(6621)
Principles of Data Fabric by Sonia Mezzetta(6374)
Learn Blender Simulations the Right Way by Stephen Pearson(6269)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6137)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5806)
RPA Solution Architect's Handbook by Sachin Sahgal(5533)
Big Data Analysis with Python by Ivan Marin(5358)
The Infinite Retina by Robert Scoble Irena Cronin(5228)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5144)
Pretrain Vision and Large Language Models in Python by Emily Webber(4317)
Infrastructure as Code for Beginners by Russ McKendrick(4078)
Functional Programming in JavaScript by Mantyla Dan(4038)
The Age of Surveillance Capitalism by Shoshana Zuboff(3948)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3792)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3596)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3569)
